<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>

    <style>

    </style>
    <script src="vue.js"></script>
</head>
<body>
<div id="box">
    {{msg}}
</div>
<script>
    var model = {
        msg : 'well'
    };
    var vm=new Vue({
        el:'#box',
        data:model,
        created:function(){
            alert('实例已经创建');
        },
        beforeCompile:function(){
            alert('编译之前');
        },
        compiled:function(){
            alert('编译之后');
        },
        ready:function(){
            alert('插入到文档中');
        },
        beforeDestroy:function(){
            alert('销毁之前');
        },
        destroyed:function(){
            alert('销毁之后');
        }
    });

    /*点击页面销毁vue对象*/
    document.onclick=function(){
        vm.$destroy();
    };
</script>
</body>
</html>



















